/*
 * @Author: 'zhangkeqq' '2211709169@qq.com'
 * @Date: 2025-07-24 15:47:45
 * @LastEditors: 'zhangkeqq' '2211709169@qq.com'
 * @LastEditTime: 2025-08-04 14:09:41
 * @FilePath: \vue3-admin\src\router\routes.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
export const constantRoute = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    name: "login",
    path: "/login",
    component: () => import("@/views/login/index.vue"),
    meta: {
      hidden: false,
    },
  },
  {
    name: "menu",
    path: "/menu",
    component: () => import("@/views/menu/index.vue"),
    children: [
      {
        name: "home",
        path: "/home",
        icon: "House",
        meta: { title: "首页" },
        component: import("@/views/home/index.vue"),
      },
    ],
  },

  {
    path: "/404",
    component: () => import("@/views/404/index.vue"),
    name: "404",
    meta: {
      hidden: true,
    },
  },
];

//异步路由
export const asyncRoute = [
  {
    name: "set",
    path: "/set",
    icon: "setting",
    meta: { title: "设置" },
    component: import("@/views/set/index.vue"),
  },
  {
    name: "overview",
    path: "/overview",
    icon: "Grid",
    meta: { title: "系统概览" },
    component: import("@/views/overview/index.vue"),
  },

  {
    name: "file",
    path: "/file",
    icon: "Folder",
    meta: { title: "文件管理" },
    component: import("@/views/file/index.vue"),
  },
  {
    name: "operation_log",
    path: "/operation_log",
    icon: "pointer",
    meta: { title: "操作日志" },
    component: import("@/views/operation_log/index.vue"),
  },
  {
    name: "login_log",
    path: "/login_log",
    icon: "Tools",
    meta: { title: "登录日志" },
    component: import("@/views/login_log/index.vue"),
  },
  {
    name: "users",
    path:"/users",
    icon: "User",
    meta: {
      title: "用户管理",
    },
    component: () => import("@/views/menu/index.vue"),
    redirect: "/users/product_manage",
    children: [
      {
        name: "product_manage",
        path: "/users/product_manage",
        meta: { title: "产品管理员" },
        component: import("@/views/user_manage/product_manage/index.vue"),
      },
      {
        name: "message_manage",
        path: "/users/message_manage",
        meta: { title: "消息管理员" },
        component: import("@/views/user_manage/message_manage/index.vue"),
      },
      {
        name: "user_list",
        path: "/users/user_list",
        meta: { title: "用户列表" },
        component: import("@/views/user_manage/user_list/index.vue"),
      },
      {
        name: "users_manage",
        path: "/users/users_manage",
        meta: { title: "用户管理" },
        component: import("@/views/user_manage/users_manage/index.vue"),
      },
    ],
  },
  {
    path: "/product",
    name: "product",
    icon: "Goods",
    meta: { title: "产品管理" },
    component: () => import("@/views/menu/index.vue"),
    children: [
      {
        name: "product_manage_list",
        path: "/product/product_manage_list",
        meta: { title: "产品列表" },
        component: import("@/views/product/product_manage_list/index.vue"),
      },
      {
        name: "out_product_manage_list",
        path: "/product/out_product_manage_list",
        meta: { title: "出库列表" },
        component: import("@/views/product/out_product_manage_list/index.vue"),
      },
    ],
  },
  {
    path: "/message",
    name: "message",
    icon: "ChatDotRound",
    meta: {
      title: "消息管理",
    },
    component: () => import("@/views/menu/index.vue"),
    children: [
      {
        name: "message_list",
        path: "/message/message_list",
        meta: { title: "消息列表" },
        component: import("@/views/message/message_list/index.vue"),
      },
      {
        name: "recycle",
        path: "/message/recycle",
        meta: { title: "回收站" },
        component: import("@/views/message/recycle/index.vue"),
      },
    ],
  },
];

// 任意路由 （匹配不到的路由）
export const anyRoute = [
  {
    path: "/:pathMatch(.*)*",
    redirect: "/404",
    name: "Any",
    meta: {
      hidden: true,
    },
  },
];
